#include<iostream>
using namespace std;

#define INT_MAX       2147483647

int main()
{
	int n,num;
	while(cin>>n)
	{
		int *a=new int[n];
		int *b=new int[n];
		int temp=INT_MAX;
		for(int i=0;i<n;i++)
		{
			cin>>a[i]>>b[i];
			if(a[i]<temp)temp=a[i];
		}
		int min=INT_MAX;
		for(int j=0;j<n;j++)
		{
			if(a[j]==temp&&b[j]<min){ min=b[j]; num=j;}
		}
		cout<<a[num]<<' '<<b[num]<<endl;		

		delete []b;
		delete []a;
	}
	return 0;
}